﻿function addRowToTable() {
    Param (
        [string]$level = 0,
        [string]$mgName = '',
        [string]$mgId = '',
        [string]$mgParentId = '',
        [string]$mgParentName = '',
        [string]$mgASCSecureScore = '',
        [string]$Subscription = '',
        [string]$SubscriptionId = '',
        [string]$SubscriptionQuotaId = '',
        [string]$SubscriptionState = '',
        [string]$SubscriptionASCSecureScore = '',
        [string]$SubscriptionTags = '',
        [int]$SubscriptionTagsCount = 0,
        [string]$Policy = '',
        [string]$PolicyAvailability = '',
        [string]$PolicyDescription = '',
        [string]$PolicyVariant = '',
        [string]$PolicyType = '',
        $PolicyIsALZ = '',
        [string]$PolicyCategory = '',
        [string]$PolicyDefinitionIdGuid = '',
        [string]$PolicyDefinitionId = '',
        [string]$PolicyDefintionScope = '',
        [string]$PolicyDefintionScopeMgSub = '',
        [string]$PolicyDefintionScopeId = '',
        [int]$PolicyDefinitionsScopedLimit = 0,
        [int]$PolicyDefinitionsScopedCount = 0,
        [int]$PolicySetDefinitionsScopedLimit = 0,
        [int]$PolicySetDefinitionsScopedCount = 0,
        [string]$PolicyDefinitionEffectDefault = '',
        [string]$PolicyDefinitionEffectFixed = '',
        [string]$PolicyAssignmentScope = '',
        [string]$PolicyAssignmentScopeMgSubRg = '',
        [string]$PolicyAssignmentScopeName = '',
        $PolicyAssignmentNotScopes = '',
        [string]$PolicyAssignmentId = '',
        [string]$PolicyAssignmentName = '',
        [string]$PolicyAssignmentDisplayName = '',
        [string]$PolicyAssignmentDescription = '',
        [string]$PolicyAssignmentEnforcementMode = '',
        $PolicyAssignmentNonComplianceMessages = '',
        [string]$PolicyAssignmentIdentity = '',
        [int]$PolicyAssignmentLimit = 0,
        [int]$PolicyAssignmentCount = 0,
        [int]$PolicyAssignmentAtScopeCount = 0,
        $PolicyAssignmentParameters,
        $PolicyAssignmentParametersFormated,
        [int]$PolicySetAssignmentLimit = 0,
        [int]$PolicySetAssignmentCount = 0,
        [int]$PolicySetAssignmentAtScopeCount = 0,
        [int]$PolicyAndPolicySetAssignmentAtScopeCount = 0,
        [string]$PolicyAssignmentAssignedBy = '',
        [string]$PolicyAssignmentCreatedBy = '',
        [string]$PolicyAssignmentCreatedOn = '',
        [string]$PolicyAssignmentUpdatedBy = '',
        [string]$PolicyAssignmentUpdatedOn = '',
        [string]$RoleDefinitionId = '',
        [string]$RoleDefinitionName = '',
        [string]$RoleAssignmentIdentityDisplayname = '',
        [string]$RoleAssignmentIdentitySignInName = '',
        [string]$RoleAssignmentIdentityObjectId = '',
        [string]$RoleAssignmentIdentityObjectType = '',
        [string]$RoleAssignmentId = '',
        [string]$RoleAssignmentScope = '',
        [string]$RoleAssignmentScopeName = '',
        [string]$RoleAssignmentScopeRG = '',
        [string]$RoleAssignmentScopeRes = '',
        [string]$RoleAssignmentScopeType = '',
        [string]$RoleAssignmentCreatedBy = '',
        [string]$RoleAssignmentCreatedOn = '',
        $RoleAssignmentCreatedOnUnformatted,
        [string]$RoleAssignmentUpdatedBy = '',
        [string]$RoleAssignmentUpdatedOn = '',
        [string]$RoleIsCustom = '',
        [string]$RoleAssignableScopes = '',
        [int]$RoleAssignmentsLimit = 0,
        [int]$RoleAssignmentsCount = 0,
        [string]$RoleActions = '',
        [string]$RoleNotActions = '',
        [string]$RoleDataActions = '',
        [string]$RoleNotDataActions = '',
        $RoleCanDoRoleAssignments,
        [int]$RoleSecurityCustomRoleOwner = 0,
        [int]$RoleSecurityOwnerAssignmentSP = 0,
        [string]$BlueprintName = '',
        [string]$BlueprintId = '',
        [string]$BlueprintDisplayName = '',
        [string]$BlueprintDescription = '',
        [string]$BlueprintScoped = '',
        [string]$BlueprintAssignmentVersion = '',
        [string]$BlueprintAssignmentId = '',
        [string]$RoleAssignmentPIM = '',
        [string]$RoleAssignmentPIMAssignmentType = '',
        $RoleAssignmentPIMSlotStart = '',
        $RoleAssignmentPIMSlotEnd = ''
    )

    $null = $script:newTable.Add([PSCustomObject]@{
            level                                    = $level
            mgName                                   = $mgName
            mgId                                     = $mgId
            mgParentId                               = $mgParentId
            mgParentName                             = $mgParentName
            mgASCSecureScore                         = $mgASCSecureScore
            Subscription                             = $Subscription
            SubscriptionId                           = $SubscriptionId
            SubscriptionQuotaId                      = $SubscriptionQuotaId
            SubscriptionState                        = $SubscriptionState
            SubscriptionASCSecureScore               = $SubscriptionASCSecureScore
            SubscriptionTags                         = $SubscriptionTags
            SubscriptionTagsCount                    = $SubscriptionTagsCount
            Policy                                   = $Policy
            PolicyAvailability                       = $PolicyAvailability
            PolicyDescription                        = $PolicyDescription
            PolicyVariant                            = $PolicyVariant
            PolicyType                               = $PolicyType
            PolicyIsALZ                              = $PolicyIsALZ
            PolicyCategory                           = $PolicyCategory
            PolicyDefinitionIdGuid                   = $PolicyDefinitionIdGuid
            PolicyDefinitionId                       = $PolicyDefinitionId
            PolicyDefintionScope                     = $PolicyDefintionScope
            PolicyDefintionScopeMgSub                = $PolicyDefintionScopeMgSub
            PolicyDefintionScopeId                   = $PolicyDefintionScopeId
            PolicyDefinitionsScopedLimit             = $PolicyDefinitionsScopedLimit
            PolicyDefinitionsScopedCount             = $PolicyDefinitionsScopedCount
            PolicySetDefinitionsScopedLimit          = $PolicySetDefinitionsScopedLimit
            PolicySetDefinitionsScopedCount          = $PolicySetDefinitionsScopedCount
            PolicyDefinitionEffectDefault            = $PolicyDefinitionEffectDefault
            PolicyDefinitionEffectFixed              = $PolicyDefinitionEffectFixed
            PolicyAssignmentScope                    = $PolicyAssignmentScope
            PolicyAssignmentScopeMgSubRg             = $PolicyAssignmentScopeMgSubRg
            PolicyAssignmentScopeName                = $PolicyAssignmentScopeName
            PolicyAssignmentNotScopes                = $PolicyAssignmentNotScopes
            PolicyAssignmentId                       = $PolicyAssignmentId
            PolicyAssignmentName                     = $PolicyAssignmentName
            PolicyAssignmentDisplayName              = $PolicyAssignmentDisplayName
            PolicyAssignmentDescription              = $PolicyAssignmentDescription
            PolicyAssignmentEnforcementMode          = $PolicyAssignmentEnforcementMode
            PolicyAssignmentNonComplianceMessages    = $PolicyAssignmentNonComplianceMessages
            PolicyAssignmentIdentity                 = $PolicyAssignmentIdentity
            PolicyAssignmentLimit                    = $PolicyAssignmentLimit
            PolicyAssignmentCount                    = $PolicyAssignmentCount
            PolicyAssignmentAtScopeCount             = $PolicyAssignmentAtScopeCount
            PolicyAssignmentParameters               = $PolicyAssignmentParameters
            PolicyAssignmentParametersFormated       = $PolicyAssignmentParametersFormated
            PolicySetAssignmentLimit                 = $PolicySetAssignmentLimit
            PolicySetAssignmentCount                 = $PolicySetAssignmentCount
            PolicySetAssignmentAtScopeCount          = $PolicySetAssignmentAtScopeCount
            PolicyAndPolicySetAssignmentAtScopeCount = $PolicyAndPolicySetAssignmentAtScopeCount
            PolicyAssignmentAssignedBy               = $PolicyAssignmentAssignedBy
            PolicyAssignmentCreatedBy                = $PolicyAssignmentCreatedBy
            PolicyAssignmentCreatedOn                = $PolicyAssignmentCreatedOn
            PolicyAssignmentUpdatedBy                = $PolicyAssignmentUpdatedBy
            PolicyAssignmentUpdatedOn                = $PolicyAssignmentUpdatedOn
            RoleDefinitionId                         = $RoleDefinitionId
            RoleDefinitionName                       = $RoleDefinitionName
            RoleAssignmentIdentityDisplayname        = $RoleAssignmentIdentityDisplayname
            RoleAssignmentIdentitySignInName         = $RoleAssignmentIdentitySignInName
            RoleAssignmentIdentityObjectId           = $RoleAssignmentIdentityObjectId
            RoleAssignmentIdentityObjectType         = $RoleAssignmentIdentityObjectType
            RoleAssignmentId                         = $RoleAssignmentId
            RoleAssignmentScope                      = $RoleAssignmentScope
            RoleAssignmentScopeName                  = $RoleAssignmentScopeName
            RoleAssignmentScopeRG                    = $RoleAssignmentScopeRG
            RoleAssignmentScopeRes                   = $RoleAssignmentScopeRes
            RoleAssignmentScopeType                  = $RoleAssignmentScopeType
            RoleIsCustom                             = $RoleIsCustom
            RoleAssignableScopes                     = $RoleAssignableScopes
            RoleAssignmentCreatedBy                  = $RoleAssignmentCreatedBy
            RoleAssignmentCreatedOn                  = $RoleAssignmentCreatedOn
            RoleAssignmentCreatedOnUnformatted       = $RoleAssignmentCreatedOnUnformatted
            RoleAssignmentUpdatedBy                  = $RoleAssignmentUpdatedBy
            RoleAssignmentUpdatedOn                  = $RoleAssignmentUpdatedOn
            RoleAssignmentsLimit                     = $RoleAssignmentsLimit
            RoleAssignmentsCount                     = $RoleAssignmentsCount
            RoleActions                              = $RoleActions
            RoleNotActions                           = $RoleNotActions
            RoleDataActions                          = $RoleDataActions
            RoleNotDataActions                       = $RoleNotDataActions
            RoleCanDoRoleAssignments                 = $RoleCanDoRoleAssignments
            RoleSecurityCustomRoleOwner              = $RoleSecurityCustomRoleOwner
            RoleSecurityOwnerAssignmentSP            = $RoleSecurityOwnerAssignmentSP
            BlueprintName                            = $BlueprintName
            BlueprintId                              = $BlueprintId
            BlueprintDisplayName                     = $BlueprintDisplayName
            BlueprintDescription                     = $BlueprintDescription
            BlueprintScoped                          = $BlueprintScoped
            BlueprintAssignmentVersion               = $BlueprintAssignmentVersion
            BlueprintAssignmentId                    = $BlueprintAssignmentId
            RoleAssignmentPIM                        = $RoleAssignmentPIM
            RoleAssignmentPIMAssignmentType          = $RoleAssignmentPIMAssignmentType
            RoleAssignmentPIMSlotStart               = $RoleAssignmentPIMSlotStart
            RoleAssignmentPIMSlotEnd                 = $RoleAssignmentPIMSlotEnd
        })
}